import React, {Component} from 'react';
import {Form, Input, Button} from 'antd';

import './login.less';

class Index extends Component {


    onFinish = (values) => {

        console.log(values, '成功');

    }

    onFinishFailed = (errors) => {


        console.log(errors, '验证失败');

    }

    render() {
        return (

            <div className="login-wrap">
                <div className="form">

                    <h2 className="title">xxx公司-cms系统管理后台</h2>
                    <Form
                        className="login-form"
                        onFinish={this.onFinish}
                        onFinishFailed={this.onFinishFailed}
                        autoComplete="off"
                    >
                        <Form.Item
                            label="用户名"
                            name="username"
                            rules={[
                                {
                                    required: true,
                                    message: '用户名不能为空！',
                                },
                            ]}
                        >
                            <Input/>
                        </Form.Item>

                        <Form.Item
                            label="密码"
                            name="password"
                            rules={[
                                {
                                    required: true,
                                    message: '密码不能为空!',
                                },
                            ]}
                        >
                            <Input.Password/>
                        </Form.Item>

                        <Form.Item
                            wrapperCol={{
                                offset: 8,
                                span: 16,
                            }}
                        >
                            <Button type="primary" htmlType="submit">
                                登录
                            </Button>
                        </Form.Item>
                    </Form>
                </div>
            </div>
        );
    }
}

export default Index;
